<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('选择组织对象')"/>
    <style>

        .layui-border-box {
            height: 520px !important;
        }

        .layui-table-body {
            height: 450px !important;
        }

        .hang {
            display: inline-block;
            width: 50%;
        }


    </style>
</head>
<body>
<form>
    <div style="padding: 0 10px;">
        <div class="north">
            <div class="layui-form-item">
                <div th:if="${fmoduleTable=='TS_CUSTOMSCLEARANCE'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">物流单号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="code" type="text" name="code" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:35%">
                        <label class="layui-form-label" style="padding: 9px 0;width:85px">物流名称</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="namelogsticsway" type="text" name="namelogsticsway" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='HW_FINALSTATEMENT'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">FBA编号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="shipmentid" type="text" name="shipmentid" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:35%">
                        <label class="layui-form-label" style="padding: 9px 0;width:85px">海外尾程单号</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="pbid" type="text" name="pbid" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='TCC_StockUpdate'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:84px">合并商品编码</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="codeMerge" type="text" name="codeMerge" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:35%">
                        <label class="layui-form-label" style="padding: 9px 0;width:85px">商品编码</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="productCode" type="text" name="productCode" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='HW_FINALPAYMENT'}"
                     class="hang">
                    <div class="layui-inline" style="width:35%">
                        <label class="layui-form-label" style="padding: 9px 0;width:85px">海外尾程单号</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="pbid" type="text" name="pbid" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='HW_PAYMENT'}"
                     class="hang">
                    <div class="layui-inline" style="width:35%">
                        <label class="layui-form-label" style="padding: 9px 0;width:85px">海外对账单号</label>
                        <div class="layui-input-block" style="margin-left: 97px;">
                            <input id="dzBid" type="text" name="dzBid" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='TP_FBALOGSTICSORDER' || fmoduleTable=='TP_FBALOGISTICSPAYMENT'|| fmoduleTable=='TP_FBALOGISTICSPAYMENTEC'|| fmoduleTable=='TP_FBALOGSTICSORDEREC'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">物流订单号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="logisticsOrderCode" type="text" name="code" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">物流运单号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="waybillNumber" type="text" name="vGsJc" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='YS_HYDICT'}" class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">尾程方式</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="dictname" type="text" name="dictname" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${ fmoduleTable=='TP_FBAPLANORDER'|| fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE' || fmoduleTable=='TCG_PURCHASEPLAN' || fmoduleTable=='TCG_PURCHASEPLANCANCEL' || fmoduleTable=='TCG_OFFLINEPURCHASEORDER'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">商品编码</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="code" type="text" name="code" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">商品名称</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="name" type="text" name="name" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">公司简称</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="vGsJc" type="text" name="vGsJc" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${ fmoduleTable=='HW_DELIVERYREQUEST_GUAGE'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">商品编码</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="code" type="text" name="code" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">商品名称</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="name" type="text" name="name" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div th:if="${fmoduleTable=='TCG_PAYMENT' || fmoduleTable=='TCG_OFFLINEPAYMENT'}" class="hang">
                    <div class="layui-inline" style="width:45%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">单据编号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="bid" type="text" name="bid" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:45%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">计划单号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="planID" type="text" name="planID" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div th:if="${ fmoduleTable=='TCW_CAPITALREGISTER'}"
                     class="hang">
                    <div class="layui-inline" style="width:40%">
                        <label class="layui-form-label" style="padding: 9px 0;width:100px">运营服务商编码</label>
                        <div class="layui-input-block" style="margin-left: 105px;">
                            <input id="partnerId" type="text" name="partnerId" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:40%">
                        <label class="layui-form-label" style="padding: 9px 0;width:100px">运营服务商名称</label>
                        <div class="layui-input-block" style="margin-left: 105px;">
                            <input id="partnerName" type="text" name="partnerName" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <!--
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">运营服务商开户行</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="vKhh" type="text" name="vKhh" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">运营服务商银行账号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="vYhZh" type="text" name="vYhZh" autocomplete="off" class="layui-input">
                        </div>
                    </div>-->
                </div>



                <!--
                <div th:if="${ fmoduleTable=='TCW_CAPITALREGISTERCLAIM'}"
                     class="hang">
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">Id</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="id" type="text" name="id" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">付款银行户名</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="paymentBankName" type="text" name="paymentBankName" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">付款开户行</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="paymentBank" type="text" name="paymentBank" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width:30%">
                        <label class="layui-form-label" style="padding: 9px 0;width:70px">付款银行账号</label>
                        <div class="layui-input-block" style="margin-left: 75px;">
                            <input id="paymentBankAccount" type="text" name="paymentBankAccount" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>-->

                <div class="layui-inline" style="line-height: 34px;">
                    <a class="layui-btn layuiadmin-btn-order dhicon dh-search" id="btn-search"><span
                            class="fa_span">查询</span></a>
                    <button type="reset" class="layui-btn layui-btn-primary dhicon dh-refresh reset" id="dh-resets">
                        <span class="fa_span">重置</span></button>
                </div>
            </div>
        </div>
        <div class="south">
            <div class="left">
                <div th:style="${pagetype == 'checkbox'}?'float:left;width:45%':'float:left;width:100%'">
                    <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
                </div>
                <div class="layui-btn-container" style="width: 50px;text-align: center;margin-top:10%;float:left;"
                     th:if="${pagetype == 'checkbox'}">
                    <div class="layui-btn addbtn layui-btn-disabled" style="padding:0 10px;margin-right: 0;">
                        <p class="layui-icon layui-icon-next" style="font-size:14px;margin:0;color:#C9C9C9"></p>
                    </div>
                    <div class="layui-btn delbtn layui-btn-disabled" style="padding:0 10px;margin-right: 0;">
                        <p class="layui-icon layui-icon-prev" style="font-size:14px;margin:0;color:#C9C9C9"></p>
                    </div>
                </div>
                <div style="float:left;width:45%">
                    <table class="layui-hide" id="dhtable2" lay-filter="ftable2"
                           th:if="${pagetype == 'checkbox'}"></table>
                </div>
            </div>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<script>
    /*<![CDATA[*/
    var pagetype = "[[${pagetype}]]";
    var selectedObject = "[[${selectedObject}]]";
    var fmoduleTable = "[[${fmoduleTable}]]";
    var vGsBm = "[[${vGsBm}]]";
    var codereconcile = "[[${codereconcile}]]";
    var nameLogsticsServer = "[[${nameLogsticsServer}]]";
    var codeCompany = "[[${codeCompany}]]";
    var warehouseAddress="[[${warehouseAddress}]]";//海外仓发货申请需要
    //资金登记认领表需要
    var paymentTime="[[${paymentTime}]]";
    var paymentBankName="[[${paymentBankName}]]";
    var paymentBank="[[${paymentBank}]]";
    var paymentBankAccount="[[${paymentBankAccount}]]";
    var paymentAmount="[[${paymentAmount}]]";

    /*]]>*/
    // console.log(pagetype,fmoduleTable,66)
    // 'TCG_PURCHASEPLAN    '计划
    // 'TCG_PURCHASEPLANCANCEL  '取消计划
    // 'TCG_OFFLINEPURCHASEORDER  '线下采购
    // 'TCG_PAYMENT  '线上付款
    var wlh = window.location.href,wlhPars = wlh.split('?')[1]?('&'+wlh.split('?')[1]):'';
    console.log("wlhPars",wlhPars)
    if (pagetype == "checkbox") {
        var typeobj = {type: 'checkbox'}
    } else {
        var typeobj = {type: 'radio'}
    }
    var furl = "", fcols = []
    if (fmoduleTable == 'HW_FINALSTATEMENT') {
        furl = "/storage/hwTailprogram/hwTailprogramList?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'pguid', title: 'pguid', width: 100,hide: true}
            ,{align: 'center',field: 'codeqdcompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'namecompany', title: '物流渠道账户名称', width: 100,hide: true}
            ,{align: 'center',field: 'bid', title: '海外尾程单号', width: 160}
            ,{align: 'center',field: 'stockOutCode', title: '海外尾程出库单号', width: 150}
            ,{align: 'center',field: 'shipmentid', title: 'FBA编号', width: 120}
            ,{align: 'center',field: 'vgsjc', title: '公司简称', width: 100}
            ,{align: 'center',field: 'shopName', title: '网店名称', width: 100}
            ,{align: 'center',field: 'launchwarehouse', title: '发出仓库', width: 100}
            ,{align: 'center',field: 'destinationfulfillmentcenterid', title: '目的仓库', width: 100}
            ,{align: 'center',field: 'countrycode', title: '国家', width: 100}
            ,{align: 'center',field: 'city', title: '城市', width: 100}
            ,{align: 'center',field: 'weightreal', title: '实重', width: 100}
            ,{align: 'center',field: 'weightvol', title: '抛重', width: 100}
            ,{align: 'center',field: 'weightcal', title: '计重', width: 100}
            ,{align: 'center',field: 'numbox', title: '箱数', width: 100}
            ,{align: 'center',field: 'numcommodity', title: '商品数量', width: 100}
            ,{align: 'center',field: 'lastvoyagecharge', title: '尾程费(系统)', width: 120}
        ]
    }else if (fmoduleTable == 'TS_CUSTOMSCLEARANCE') {
        furl = "/storage/tsCustomsclearance/list2?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'code', title: '物流单号'}
            ,{align: 'center',field: 'namelogsticsway', title: '物流名称'}
            ,{align: 'center',field: 'codelogsticsserver', title: '物流服务商'}
            ,{align: 'center',field: 'guidYl', title: '订单原id',hide: true}
        ]
    }else if (fmoduleTable == 'TCC_StockUpdate') {
        furl = "/storage/stockUpdate/list2?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'guidKc', title: '库存guid', width: 100,hide: true}
            ,{align: 'center',field: 'codeMerge', title: '合并商品编码', width: 100}
            ,{align: 'center',field: 'productCode', title: '商品编码', width: 100}
            ,{align: 'center',field: 'productName', title: '商品名称', width: 100}
            ,{align: 'center',field: 'productNum', title: '商品可用数量', width: 120}
            ,{align: 'center',field: 'productNumAll', title: '商品总数量', width: 120}
            ,{align: 'center',field: 'vHw', title: '货位', width: 100}
            ,{align: 'center',field: 'vKq', title: '库区', width: 100}
            ,{align: 'center',field: 'gDepot', title: '所在仓库', width: 100}
        ]
    } else if (fmoduleTable == 'YS_HYDICT') {
        furl = "/system/ysDict/list?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'dictname', title: '尾程方式', width: 100 }
            ,{align: 'center',field: 'dictvalue', title: 'Api参数', width: 100 }
            ,{align: 'center',field: 'id', title: 'id', width: 100,hide: true}
        ]
    } else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENT') {
        furl = "/logstics/fbaLogisticsReconcile/fbaLogisticsReconcileList?codeCompany=" + codeCompany + "&codereconcile=" + codereconcile;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'codereconcile', title: '物流对账单号', width: 100 }
            ,{align: 'center',field: 'logisticsOrderCode', title: '物流订单号', width: 100 }
            ,{align: 'center',field: 'waybillNumber', title: '物流运单号', width: 100}
            ,{align: 'center',field: 'logisticsFeesSj', title: '系统物流运费', width: 100}
            ,{align: 'center',field: 'logisticsFeesDz', title: '对账物流运费', width: 100}
            ,{align: 'center',field: 'logisticsFeesFk', title: '付款物流运费', width: 100}
            ,{align: 'center',field: 'logisticsFeesXs', title: '销售物流运费', width: 100}
            ,{align: 'center',field: 'codeCompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'nameCompany', title: '物流渠道账户名称', width: 100,hide: true}
            ,{align: 'center',field: 'type', title: '类型', width: 100,hide: true}
        ]
    }else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENTEC') {
        furl = "/logstics/fbaLogisticsReconcileEc/fbaLogisticsReconcileEcList?" +wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'codereconcileEc', title: '物流二次对账单号', width: 150 }
            ,{align: 'center',field: 'logisticsOrderCode', title: '物流订单号', width: 155 }
            ,{align: 'center',field: 'waybillNumber', title: '物流运单号', width: 120}
            ,{align: 'center',field: 'residueFees', title: '一次付款剩余运费', width: 145}
            ,{align: 'center',field: 'logisticsFeesDz', title: '二次付款物流运费', width: 145}
            ,{align: 'center',field: 'logisticsFeesFk', title: '一次付款物流运费', width: 145}
            ,{align: 'center',field: 'logisticsFeesXs', title: '销售物流运费', width: 100}
            ,{align: 'center',field: 'codeCompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'nameCompany', title: '物流渠道账户名称', width: 100,hide: true}
            ,{align: 'center',field: 'type', title: '类型', width: 100,hide: true}
        ]
    } else if (fmoduleTable == 'HW_FINALPAYMENT') {
        furl = "/storage/hwFinalstatement/hwFinalStatementList?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'tpBid', title: '海外尾程单', width: 100 }
            ,{align: 'center',field: 'fsBid', title: '尾程对账单号', width: 100 }
            ,{align: 'center',field: 'stockOutCode', title: '海外尾程出库单', width: 100}
            ,{align: 'center',field: 'lastVoyageChargeXt', title: '系统物流运费', width: 100}
            ,{align: 'center',field: 'lastvoyagechargedz', title: '对账物流运费', width: 100}
            ,{align: 'center',field: 'lastVoyageChargeFk', title: '付款物流运费', width: 100}
            ,{align: 'center',field: 'codeCompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'nameCompany', title: '物流渠道账户名称', width: 100,hide: true}
        ]
    } else if (fmoduleTable == 'HW_PAYMENT') {
        furl = "/storage/hwReconcile/hwReconcileList?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'dzBid', title: '海外仓对账单单号', width: 170 }
            ,{align: 'center',field: 'hwMonth', title: '月份', width: 100}
            ,{align: 'center',field: 'sjRkAmount', title: '入库手续费（实际）', width: 150}
            ,{align: 'center',field: 'sjKcAmount', title: '库存仓储费（实际）', width: 150}
            ,{align: 'center',field: 'sjCkAmount', title: '出库费用（实际）', width: 150}
            ,{align: 'center',field: 'sjAmount', title: '对账总金额（实际）', width: 150}
        ]
    } else if (fmoduleTable == 'TP_FBALOGSTICSORDER') {
        furl = "/logstics/fbaLogisticsOrder/logsticsOrderList?codereconcile=" + codereconcile+"&codeLogsticsServer="+nameLogsticsServer;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'logisticsOrderCode', title: '物流订单号', width: 100 }
            ,{align: 'center',field: 'nameLogsticsWay', title: '物流方式名称', width: 100}
            ,{align: 'center',field: 'codeLogsticsServer', title: '物流服务商', width: 100}
            ,{align: 'center',field: 'nameLogsticsPattern', title: '物流名称', width: 100}
            ,{align: 'center',field: 'waybillNumber', title: '物流运单号', width: 100}
            ,{align: 'center',field: 'logisticsFeesSj', title: '系统物流运费', width: 100}
            ,{align: 'center',field: 'logisticsFeesXs', title: '销售物流运费', width: 100}
            ,{align: 'center',field: 'numBoxXt', title: '系统箱数', width: 100}
            ,{align: 'center',field: 'weightCalXt', title: '系统计重', width: 110}
            ,{align: 'center',field: 'logisticsFreightXt', title: '系统计重运费', width: 100}
            ,{align: 'center',field: 'materialSurchargeXt', title: '系统材质附加费', width: 100}
            ,{align: 'center',field: 'priceClearanceOpeXt', title: '系统清关费', width: 100}
            ,{align: 'center',field: 'priceProNameExtraPredictXt', title: '系统品名附加费', width: 100}
            ,{align: 'center',field: 'codeCompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'nameCompany', title: '物流渠道账户名称', width: 100,hide: true}
            ,{align: 'center',field: 'type', title: '类型', width: 100,hide: true}
        ]
    }  else if (fmoduleTable == 'TP_FBALOGSTICSORDEREC') {
        furl = "/logstics/fbaLogisticsReconcile/ecReconcileList?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            ,{align: 'center',field: 'logisticsOrderCode', title: '物流订单号', width: 160 }
            ,{align: 'center',field: 'codereconcile', title: '物流对账单号', width: 100 ,hide: true}
            ,{align: 'center',field: 'nameLogsticsWay', title: '物流方式名称', width: 100}
            ,{align: 'center',field: 'codeLogsticsServer', title: '物流服务商', width: 100}
            ,{align: 'center',field: 'nameLogsticsPattern', title: '物流名称', width: 150}
            ,{align: 'center',field: 'waybillNumber', title: '物流运单号', width: 130}
            ,{align: 'center',field: 'logisticsFeesXs', title: '销售物流运费', width: 100}
            ,{align: 'center',field: 'logisticsFeesFk', title: '付款物流运费', width: 100}
            ,{align: 'center',field: 'codeCompany', title: '物流渠道账户编码', width: 100,hide: true}
            ,{align: 'center',field: 'nameCompany', title: '物流渠道账户名称', width: 100,hide: true}
            ,{align: 'center',field: 'type', title: '类型', width: 100,hide: true}
        ]
    } else if (fmoduleTable == 'TP_FBAPLANORDER') {
        furl = "/business/fbaplanorder/list2?"+wlhPars;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'code', title: '商品编码', align: 'center', width: 150}
            , {field: 'name', title: '商品名称', align: 'left', width: 200}
            // ,{field:'sku', title: 'SKU',align: 'left',width: 150}
            // ,{field:'asin', title: 'ASIN',align: 'left',width: 150}
            // ,{field:'fnsku', title: 'FNSKU',align: 'left',width: 150}
            , {field: 'nameCn', title: '商品品名(中)', width: 150}
            , {field: 'nameEn', title: '商品品名(英)', width: 150}
            , {field: 'codeHs', title: '海关编码', align: 'center', width: 150}
            , {field: 'materialCn', title: '商品材质(中)', width: 150}
            , {field: 'materialEn', title: '商品材质(英)', width: 150}
            , {field: 'priceIn', title: '商品采购价', width: 150}
            , {field: 'vHw', title: '货位编码', width: 150}
            , {field: 'vKq', title: '库区', width: 150}
            , {field: 'gDepot', title: '所在仓库', width: 150}
            , {field: 'productNum', title: '库存数量', width: 150}
            , {field: 'productWeight', title: '组装重量(g)', width: 150}
            , {field: 'productLength', title: '组装长度(cm)', width: 150}
            , {field: 'productWidth', title: '组装宽度(cm)', width: 150}
            , {field: 'productHeight', title: '组装高度(cm)', width: 150}
            , {field: 'guidKc', title: '库存id', width: 150, hide: true}
            , {field: 'rkGuid', title: '入库id', width: 150, hide: true}
            , {field: 'spGuid', title: '商品Guid', width: 150, hide: true}
            , {field: 'spId', title: '商品id', width: 150, hide: true}
            , {field: 'vGsBm', title: '运营公司', width: 150, hide: true}
            , {field: 'vSfJp', title: '是否精品', width: 150}
        ]
    } else if (fmoduleTable == 'TCG_PURCHASEPLAN') {
        furl = "/business/productactive/list?"+wlhPars
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'code', title: '商品编码', align: 'center', width: 150}
            , {field: 'codeHs', title: '海关编码', align: 'center', width: 150}
            , {field: 'name', title: '商品名称', align: 'left', width: 200}
            , {field: 'nameCn', title: '商品品名（中）', width: 150}
            , {field: 'createTime', title: '创建时间', width: 180}
            , {field: 'productNum', title: '库存数量', width: 180}
        ]
    } else if (fmoduleTable == 'TCG_PURCHASEPLANCANCEL') {
        furl = "/purchase/purchaseplan/list"
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'spBm', title: '商品编码', align: 'center', width: 200}
            , {field: 'spMc', title: '商品名称', align: 'left', width: 200}
            , {field: 'spSl', title: '采购数量', width: 180}
        ]
    } else if (fmoduleTable == 'TCG_OFFLINEPURCHASEORDER') {
        furl = "/purchase/purchaseplan/list?sort=线下&isOrder=0"+wlhPars
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'bid', title: '单据编号', align: 'center', width: 200}
            , {field: 'vGsJc', title: '采购公司简称', align: 'left', width: 200}
            , {field: 'vGsBm', title: '采购公司编码', align: 'left', width: 200}

            , {field: 'spBm', title: '商品编码', align: 'center', width: 200}
            , {field: 'spMc', title: '商品名称', align: 'left', width: 200}
            , {field: 'planCost', title: '采购计划预估金额', align: 'left', width: 200}
            , {field: 'spSl', title: '采购数量', width: 180}
        ]
    } else if (fmoduleTable == 'TCG_PAYMENT') {
        furl = "/purchase/purchaseorder/list?state=已审核&isPay=未付款"
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'bid', title: '单据编号', align: 'center', width: 200}
            , {field: 'planID', title: '计划单号', align: 'center', width: 200}
            , {field: 'account', title: '1688账号', align: 'center', width: 200}
            , {field: 'aliOrderNumber', title: '1688订单编号', align: 'left', width: 200}
            , {field: 'aliOrderAmount', title: '采购订单金额', width: 180}
            , {field: 'state', title: '订单状态', width: 180}
            , {field: 'trackingNumber', title: '物流单号', width: 180}
            , {field: 'warehouse', title: '入库单号', width: 180}
            , {field: 'nid', title: '编号', width: 180, hide: true}

        ]
    } else if (fmoduleTable == 'TCG_OFFLINEPURCHASESTORAGE') {
        furl = "/purchase/offlinepurchaseorder/list?state=未入库"+wlhPars
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'bid', title: '单据编号', align: 'center', width: 200}
            // , {field: 'planID', title: '计划单号', align: 'center',width: 200 }
            , {field: 'name', title: '商品名称', align: 'center',width: 200}
            , {field: 'code', title: '商品编码', align: 'left',width: 200}
            , {field: 'sName', title: '子件名称', align: 'left',width: 200}
            , {field: 'sCode', title: '子件编码', width: 200}
            , {field: 'vGsJc', title: '采购公司简称', width: 200}
            , {field: 'sum', title: '子件数量', width: 200}
            , {field: 'ninqty', title: '未到货数量', width: 200}
            , {field: 'nid', title: '编号', width: 180, hide: true}
            , {field: 'guid', title: '唯一标识', width: 180, hide: true}

        ]
    } else if (fmoduleTable == 'TCG_OFFLINEPAYMENT') {
        var partnerId = sessionStorage.getItem('partnerId')
        furl = "/purchase/offlinepurchaseorder/list?orPay=是&supplierCode=" + partnerId
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'bid', title: '单据编号', align: 'center', width: 200}
            , {field: 'planID', title: '计划单号', align: 'center', width: 200}
            , {field: 'supplierCode', title: '供应商编码', align: 'center', width: 200}
            , {field: 'supplierName', title: '供应商名称', align: 'left', width: 200}
            , {field: 'sCode', title: '子件编码', width: 180 }
            , {field: 'sName', title: '子件名称', width: 180 }
            , {field: 'sum', title: '子件采购总数', width: 180 }
            , {field: 'code', title: '商品编码', width: 180}
            , {field: 'name', title: '商品名称', width: 180}
            , {field: 'orderAmount', title: '采购订单金额', width: 180}
            , {field: 'warehouse', title: '入库单号', width: 180}

            , {field: 'orderAddress', title: '采购下单地址', width: 180, hide: true}
            , {field: 'planToNote', title: '采购计划备注', width: 180, hide: true}
            , {field: 'orderAmount', title: '采购订单金额', width: 180, hide: true}
            , {field: 'freightCharge', title: '采购运费', width: 180, hide: true}
            , {field: 'serviceCharge', title: '采购服务费', width: 180, hide: true}
            , {field: 'aliPlace', title: '物流渠道', width: 180, hide: true}
            , {field: 'aliLogisticsCode', title: '物流单号', width: 180, hide: true}
            , {field: 'aliLogisticsBillNo', title: '物流运单号', width: 180, hide: true}
            , {field: 'warehouseTime', title: '入库时间', width: 180, hide: true}
            , {field: 'price2', title: '子件实际单价', width: 180, hide: true}
            , {field: 'cost2', title: '子件实际总价', width: 180, hide: true}

        ]
    }else if (fmoduleTable == 'HW_DELIVERYREQUEST_GUAGE') {
        furl = "/storage/deliveryRequest/selectGuageByStore?warehouseAddress="+warehouseAddress
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'name', title: '商品名称', align: 'center',width: 200}
            , {field: 'commodityCode', title: '商品编码', align: 'center',width: 200}
            , {field: 'numSingleBox', title: '单箱数量',  align: 'center',width: 200}
            , {field: 'volume', title: '箱规（cm）', align: 'center',width: 200,templet:
                    function(d){
                        return '<span>'+d.length+'*'+d.width+'*'+d.height+'</span>';
                    }
            }
            , {field: 'weight', title: '重量（kg）', align: 'center',width: 200}
            , {field: 'productNameCn', title: '商品品名',  align: 'center',width: 200}
            , {field: 'productMaterialCn', title: '商品材质',  align: 'center',width: 200}
            , {field: 'productCodeHs', title: '商品海关编码',  align: 'center',width: 200}
        ]
    }else if (fmoduleTable == 'TCW_CAPITALREGISTER') {
        if(vGsBm!=undefined && vGsBm!=null){
            furl = "/base/operatorbankinfo/list?vGsBm="+vGsBm;
        }else {
            furl = "/base/operatorbankinfo/list";
        }
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'partnerId', title: '运营服务商编码', align: 'center', width: 150}
            , {field: 'partnerName', title: '运营服务商名称', align: 'center', width: 150}
            , {field: 'vKhh', title: '运营服务商开户行', align: 'center', width: 150}
            , {field: 'vYhZh', title: '运营服务商银行账号', align: 'center', width: 150}
        ]
    }else if (fmoduleTable == 'TCW_CAPITALREGISTERCLAIM') {//资金登记认领表
        furl = "/finance/tcwCapitalRegisterClaim/findInfoListByCapitalSelectModel?paymentTime="+paymentTime+'&paymentBankName='+paymentBankName
            +'&paymentBank='+paymentBank+'&paymentBankAccount='+paymentBankAccount+'&paymentAmount='+paymentAmount;
        fcols = [
            {type: 'numbers', fixed: 'left'}
            , typeobj
            , {field: 'id', title: 'Id', align: 'center', width: 150}
            , {field: 'paymentBankName', title: '付款银行户名', align: 'center', width: 150}
            , {field: 'paymentBank', title: '付款开户行', align: 'center', width: 150}
            , {field: 'paymentBankAccount', title: '付款银行账号', align: 'center', width: 150}
            , {field: 'paymentAmount', title: '付款金额', align: 'center', width: 150}
            , {field: 'paymentTime', title: '付款时间', align: 'center', width: 150}
        ]
    }
    layui.use(['table', 'layer', 'jquery'], function () {
        console.log("furl",furl)
        var $ = layui.$, layer = layui.layer, table = layui.table, form = layui.form;
        $.tablelist.init({
            elem: '#dhtable'
            , url: furl
            , cols: [fcols]
            , height: 300
        });

        if (pagetype == "checkbox") {
            //点击table行选中复选框
            $(document).on("click", ".layui-table-body table.layui-table tbody tr", function () {
                var obj = event ? event.target : event.srcElement;
                var tag = obj.tagName;
                var checkbox = $(this).find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
                if (checkbox.length != 0) {
                    if (tag == 'DIV') {
                        checkbox.click();
                    }
                }
            });
            //点击复选框阻止冒泡
            $(document).on("click", ".layui-form-checkbox", function (e) {
                e.stopPropagation();
                var data = [], data2 = [];
                var checkStatus = table.checkStatus('dhtable');
                data = checkStatus.data;
                if (data.length > 0) {
                    $(".addbtn").removeClass("layui-btn-disabled");
                    $(".addbtn").children().css('color', '#fff');
                } else {
                    $(".addbtn").addClass("layui-btn-disabled");
                    $(".addbtn").children().css('color', '#C9C9C9');
                }
                var checkStatus2 = table.checkStatus('dhtable2');
                data2 = checkStatus2.data;
                if (data2.length > 0) {
                    $(".delbtn").removeClass("layui-btn-disabled");
                    $(".delbtn").children().css('color', '#fff');
                } else {
                    $(".delbtn").addClass("layui-btn-disabled");
                    $(".delbtn").children().css('color', '#C9C9C9');
                }
            });
        } else {
            table.on('row(ftable)', function (obj) {
//	             obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');//选中行样式
                obj.tr.find('input[lay-type="layTableRadio"]').prop("checked", true);
                var index = obj.tr.data('index')
                var thisData = table.cache.dhtable;	//dhtable 表名
                //重置数据单选属性
                layui.each(thisData, function (i, item) {
                    if (index === i) {
                        item.LAY_CHECKED = true;
                    } else {
                        delete item.LAY_CHECKED;
                    }
                });
                form.render('radio');
            });
        }
        $('#btn-search').on('click', function () {
            var code = $("#code").val();
            var name = $("#name").val();
            var vGsJc = $("#vGsJc").val();
            if (fmoduleTable == 'HW_FINALSTATEMENT') {
                var shipmentid = $("#shipmentid").val();
                var pbid = $("#pbid").val();
                table.reload('dhtable', {url: furl + "&shipmentid=" + shipmentid + "&pbid=" + pbid, page: {curr: 1}});
            } else if (fmoduleTable == 'TS_CUSTOMSCLEARANCE') {
                var code = $("#code").val();
                var namelogsticsway = $("#namelogsticsway").val();
                table.reload('dhtable', {url: furl + "&code=" + code + "&namelogsticsway=" + namelogsticsway, page: {curr: 1}});
            }else if (fmoduleTable == 'TCC_StockUpdate') {
                var codeMerge = $("#codeMerge").val();
                var productCode = $("#productCode").val();
                table.reload('dhtable', {url: furl + "&codeMerge=" + codeMerge + "&productCode=" + productCode, page: {curr: 1}});
            }else if (fmoduleTable == 'HW_FINALPAYMENT') {
                var pbid = $("#pbid").val();
                table.reload('dhtable', {url: furl  + "&pbid=" + pbid, page: {curr: 1}});
            }else if (fmoduleTable == 'HW_PAYMENT') {
                var dzBid = $("#dzBid").val();
                table.reload('dhtable', {url: furl  + "&dzBid=" + dzBid, page: {curr: 1}});
            }else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENT') {
                var logisticsOrderCode = $("#logisticsOrderCode").val();
                var waybillNumber = $("#waybillNumber").val();
                table.reload('dhtable', {url: furl + "&logisticsOrderCode=" + logisticsOrderCode + "&waybillNumber=" + waybillNumber, page: {curr: 1}});
            }else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENTEC') {
                var logisticsOrderCode = $("#logisticsOrderCode").val();
                var waybillNumber = $("#waybillNumber").val();
                table.reload('dhtable', {url: furl + "&logisticsOrderCode=" + logisticsOrderCode + "&waybillNumber=" + waybillNumber, page: {curr: 1}});
            } else if (fmoduleTable == 'TP_FBALOGSTICSORDER') {
                var logisticsOrderCode = $("#logisticsOrderCode").val();
                var waybillNumber = $("#waybillNumber").val();
                table.reload('dhtable', {url: furl + "&logisticsOrderCode=" + logisticsOrderCode + "&waybillNumber=" + waybillNumber, page: {curr: 1}});
            }  else if (fmoduleTable == 'TP_FBALOGSTICSORDEREC') {
                var logisticsOrderCode = $("#logisticsOrderCode").val();
                var waybillNumber = $("#waybillNumber").val();
                table.reload('dhtable', {url: furl + "&logisticsOrderCode=" + logisticsOrderCode + "&waybillNumber=" + waybillNumber, page: {curr: 1}});
            } else if (fmoduleTable == 'TP_FBAPLANORDER') {
                table.reload('dhtable', {url: furl + "&code=" + code + "&name=" + name+ "&vGsJc=" + vGsJc, page: {curr: 1}});
            }else if (fmoduleTable == 'TCW_CAPITALREGISTER') {
                table.reload('dhtable', {url: furl + "&partnerId=" +  $("#partnerId").val()+ "&partnerName=" +  $("#partnerName").val() , page: {curr: 1}});
            }else if (fmoduleTable == 'TCW_CAPITALREGISTERCLAIM') {
                table.reload('dhtable', {url: furl , page: {curr: 1}});
            }else if (fmoduleTable == 'YS_HYDICT') {
                var dictname = $("#dictname").val();
                table.reload('dhtable', {url: furl + "&dictname=" + dictname, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_PURCHASEPLAN') {
                table.reload('dhtable', {url: furl + "&code=" + code + "&name=" + name+ "&vGsJc=" + vGsJc, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_OFFLINEPURCHASESTORAGE') {
                table.reload('dhtable', {url: furl + "&code=" + code + "&name=" + name+ "&vGsJc=" + vGsJc, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_PURCHASEPLANCANCEL') {
                table.reload('dhtable', {url: furl + "?spBm=" + code + "&spMc=" + name, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_OFFLINEPURCHASEORDER') {
                table.reload('dhtable', {url: furl + "&spBm=" + code + "&spMc=" + name, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_PAYMENT') {
                var bid = $("#bid").val();
                var planID = $("#planID").val();
                table.reload('dhtable', {url: furl + "?bid=" + bid + "&planID=" + planID, page: {curr: 1}});
            } else if (fmoduleTable == 'TCG_OFFLINEPAYMENT') {
                var bid = $("#bid").val();
                var planID = $("#planID").val();
                table.reload('dhtable', {url: furl + "&bid=" + bid + "&planID=" + planID, page: {curr: 1}});
            } else if (fmoduleTable == 'HW_DELIVERYREQUEST_GUAGE') {
                table.reload('dhtable', {url: furl + "&code=" + code + "&name=" + name, page: {curr: 1}});
            }
        });
         //双击行事件：查看单据
	    table.on('rowDouble(ftable)', function(obj){
	    	var data = [obj.data];
	    	$.each(data,function(i,v){
                var flag = false;
                if(fmoduleTable=='HW_FINALSTATEMENT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.bid == dataStr[j].bid)flag = true;
                    }
                    if(!flag)dataStr.push({'pguid':v.pguid,'codeqdcompany':v.codeqdcompany,'namecompany':v.namecompany,'bid':v.bid,'stockOutCode':v.stockOutCode,'shipmentid':v.shipmentid,'vgsjc':v.vgsjc, 'shopName':v.shopName,'launchwarehouse':v.launchwarehouse,'destinationfulfillmentcenterid':v.destinationfulfillmentcenterid,'countrycode':v.countrycode,'city':v.city,
                        'weightreal':v.weightreal,'weightvol':v.weightvol,'weightcal':v.weightcal,'numbox':v.numbox,'numcommodity':v.numcommodity,'lastvoyagecharge':v.lastvoyagecharge}); //排除已选中
                }else if(fmoduleTable=='TS_CUSTOMSCLEARANCE'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.code == dataStr[j].code)flag = true;
                    }
                    if(!flag)dataStr.push({'code':v.code,'namelogsticsway':v.namelogsticsway,'codelogsticsserver':v.codelogsticsserver,'guidYl':v.guidYl}); //排除已选中
                }  else if(fmoduleTable=='TCC_StockUpdate'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guidKc == dataStr[j].guidKc)flag = true;
                    }
                    if(!flag)dataStr.push({'guidKc':v.guidKc,'codeMerge':v.codeMerge,'productCode':v.productCode,'productName':v.productName,'productNum':v.productNum,
                        'productNumAll':v.productNumAll,'vHw':v.vHw, 'vKq':v.vKq,'gDepot':v.gDepot}); //排除已选中
                } else if(fmoduleTable=='HW_FINALPAYMENT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.tpBid == dataStr[j].tpBid)flag = true;
                    }
                    if(!flag)dataStr.push({'tpBid':v.tpBid,'fsBid':v.fsBid,'stockOutCode':v.stockOutCode,'lastVoyageChargeXt':v.lastVoyageChargeXt, 'lastvoyagechargedz':v.lastvoyagechargedz,'lastVoyageChargeFk':v.lastVoyageChargeFk,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany});	//排除已选中
                } else if(fmoduleTable=='HW_PAYMENT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.dzBid == dataStr[j].dzBid)flag = true;
                    }
                    if(!flag)dataStr.push({'dzBid':v.dzBid,'hwMonth':v.hwMonth,'sjRkAmount':v.sjRkAmount,'sjKcAmount':v.sjKcAmount, 'sjCkAmount':v.sjCkAmount,'sjAmount':v.sjAmount});	//排除已选中
                }else if(fmoduleTable=='TP_FBALOGISTICSPAYMENT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)flag = true;
                    }
                    if(!flag)dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'codereconcile':v.codereconcile,'waybillNumber':v.waybillNumber,'logisticsFeesSj':v.logisticsFeesSj, 'logisticsFeesXs':v.logisticsFeesXs,'logisticsFeesDz':v.logisticsFeesDz,'logisticsFeesFk':v.logisticsFeesFk,'logisticsFreightXt':v.logisticsFreightXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});	//排除已选中
                }else if(fmoduleTable=='TP_FBALOGISTICSPAYMENTEC'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)flag = true;
                    }
                    if(!flag)dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'codereconcileEc':v.codereconcileEc,'waybillNumber':v.waybillNumber,'residueFees':v.residueFees, 'logisticsFeesXs':v.logisticsFeesXs,'logisticsFeesDz':v.logisticsFeesDz,'logisticsFeesFk':v.logisticsFeesFk,'logisticsFreightXt':v.logisticsFreightXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});	//排除已选中
                }else if(fmoduleTable=='TP_FBALOGSTICSORDER'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)flag = true;
                    }
                    if(!flag)dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'nameLogsticsWay':v.nameLogsticsWay,'codeLogsticsServer':v.codeLogsticsServer, 'nameLogsticsPattern':v.nameLogsticsPattern,'waybillNumber':v.waybillNumber,'logisticsFeesSj':v.logisticsFeesSj, 'logisticsFeesXs':v.logisticsFeesXs,'numBoxXt':v.numBoxXt,'weightCalXt':v.weightCalXt,'logisticsFreightXt':v.logisticsFreightXt,'materialSurchargeXt':v.materialSurchargeXt,'priceClearanceOpeXt':v.priceClearanceOpeXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'priceProNameExtraPredictXt':v.priceProNameExtraPredictXt,'type':v.type});	//排除已选中
                }else if(fmoduleTable=='TP_FBALOGSTICSORDEREC'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)flag = true;
                    }
                    if(!flag)dataStr.push({'logisticsFeesFk':v.logisticsFeesFk,'logisticsOrderCode':v.logisticsOrderCode,'codereconcile':v.codereconcile,'nameLogsticsWay':v.nameLogsticsWay,'codeLogsticsServer':v.codeLogsticsServer, 'nameLogsticsPattern':v.nameLogsticsPattern,'waybillNumber':v.waybillNumber, 'logisticsFeesXs':v.logisticsFeesXs,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});	//排除已选中
                }else if(fmoduleTable=='YS_HYDICT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.id == dataStr[j].id)flag = true;
                    }
                    if(!flag)dataStr.push({'id':v.id,'dictname':v.dictname,'dictvalue':v.dictvalue});	//排除已选中
                }else if(fmoduleTable=='TP_FBAPLANORDER'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guidKc == dataStr[j].guidKc)flag = true;
                    }
                    // if (v.productWeight == undefined || v.productWeight == null || v.productWeight === '') {
                    //     layer.msg(v.code+'组装信息未完善,请完善后在操作!');
                    //     return
                    // }
                    if(!flag)dataStr.push({ 'code':v.code,'name':v.name,'sku':v.sku,'asin':v.asin,'fnsku':v.fnsku,'nameCn':v.nameCn,'nameEn':v.nameEn,'codeHs':v.codeHs,'materialCn':v.materialCn, 'materialEn':v.materialEn,'priceIn':v.priceIn,'vHw':v.vHw,'vKq':v.vKq,'gDepot':v.gDepot,'productNum':v.productNum,"productWeight":v.productWeight,'productLength':v.productLength,'productWidth':v.productWidth,'productHeight':v.productHeight,'guidKc':v.guidKc,'rkGuid':v.rkGuid,'vGsBm':v.vGsBm,'spGuid':v.spGuid,'spId':v.spId,'vSfJp':v.vSfJp});	//排除已选中
                }else if(fmoduleTable=='TCW_CAPITALREGISTER'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.partnerId == dataStr[j].partnerId)flag = true;
                    }
                    if(!flag)dataStr.push({'partnerId':v.partnerId,'partnerName':v.partnerName,'vKhh':v.vKhh,'vYhZh':v.vYhZh});
                }else if(fmoduleTable=='TCW_CAPITALREGISTERCLAIM'){//资金登记认领表
                    for(var j=0; j < dataStr.length; j++){
                        if(v.id == dataStr[j].id)flag = true;
                    }
                    if(!flag)dataStr.push({'id':v.id,'paymentBankName':v.paymentBankName,'paymentBank':v.paymentBank,'paymentBankAccount':v.paymentBankAccount
                        ,'paymentAmount':v.paymentAmount,'paymentTime':v.paymentTime});
                }else if(fmoduleTable=='TCG_PURCHASEPLAN'  ){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.code == dataStr[j].code)flag = true;
                    }
                    if(!flag)dataStr.push({'code':v.code,'codeHs':v.codeHs,'name':v.name,'nameCn':v.nameCn,'createUser':v.createUser,'createTime':v.createTime,'productNum':v.productNum});	//排除已选中
                }else if(fmoduleTable=='TCG_PURCHASEPLANCANCEL'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.spBm == dataStr[j].spBm)flag = true;
                    }
                    if(!flag)dataStr.push({'spBm':v.spBm,'spMc':v.spMc,'spSl':v.spSl});	//排除已选中
                }else if(fmoduleTable=='TCG_OFFLINEPURCHASEORDER'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.spBm == dataStr[j].guid)flag = true;
                    }
                    if(!flag)dataStr.push({'bid':v.bid,'vGsJc':v.vGsJc,'vGsBm':v.vGsBm,'spBm':v.spBm,'spMc':v.spMc,'planCost':v.planCost,'spSl':v.spSl});	//排除已选中
                }else if(fmoduleTable=='TCG_PAYMENT'){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guid == dataStr[j].guid)flag = true;
                    }
                    v.guid=""
                    if(!flag)dataStr.push(v)
                    // if(!flag)dataStr.push({'bid':v.bid,'planID':v.planID,'account':v.account,'orderNumber':v.orderNumber,'orderAmount':v.orderAmount,'state':v.state,'trackingNumber':v.trackingNumber,'warehouse':v.warehouse,'nid':v.nid});	//排除已选中
                }else if(fmoduleTable=='TCG_OFFLINEPAYMENT' || fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE'){
                    v.pGuid=v.guid
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guid == dataStr[j].pGuid)flag = true;
                    }
                    if(!flag)dataStr.push(v)
                }else if(fmoduleTable=='HW_DELIVERYREQUEST_GUAGE'){
                    v.pGuid=v.gaugeMaintenanceId
                    for(var j=0; j < dataStr.length; j++){
                        if(v.gaugeMaintenanceId == dataStr[j].gaugeMaintenanceId)flag = true;
                    }
                    if(!flag)dataStr.push(v)
                }
    
            });
            rend();
            $('div.laytable-cell-checkbox').find('div.layui-form-checked').click();
            $(".addbtn").addClass("layui-btn-disabled");$(".addbtn").children().css('color','#C9C9C9');
        });
        //双击删除表二
	    table.on('rowDouble(ftable2)', function(obj){
	    	var data = [obj.data];
	    	if(fmoduleTable=='HW_FINALSTATEMENT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.bid == dataStr[j].bid)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TS_CUSTOMSCLEARANCE'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.code == dataStr[j].code)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCC_StockUpdate'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guidKc == dataStr[j].guidKc)dataStr.splice(j,1);
                    }
                });
            }else  if(fmoduleTable=='HW_FINALPAYMENT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.tpBid == dataStr[j].tpBid)dataStr.splice(j,1);
                    }
                });
            }else  if(fmoduleTable=='HW_PAYMENT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.dzBid == dataStr[j].dzBid)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TP_FBALOGISTICSPAYMENT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TP_FBALOGISTICSPAYMENTEC'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TP_FBALOGSTICSORDER'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TP_FBALOGSTICSORDEREC'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.logisticsOrderCode == dataStr[j].logisticsOrderCode)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TP_FBAPLANORDER'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guidKc == dataStr[j].guidKc)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCW_CAPITALREGISTER'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.partnerId == dataStr[j].partnerId)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCW_CAPITALREGISTERCLAIM'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.id == dataStr[j].id)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='YS_HYDICT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.id == dataStr[j].id)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCG_PURCHASEPLAN'  ){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.code == dataStr[j].code)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCG_PURCHASEPLANCANCEL'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.spBm == dataStr[j].spBm)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCG_OFFLINEPURCHASEORDER'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.spBm == dataStr[j].guid)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCG_PAYMENT'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guid == dataStr[j].guid)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='TCG_OFFLINEPAYMENT' || fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.guid == dataStr[j].pGuid)dataStr.splice(j,1);
                    }
                });
            }else if(fmoduleTable=='HW_DELIVERYREQUEST_GUAGE'){
                $.each(data,function(i,v){
                    for(var j=0; j < dataStr.length; j++){
                        if(v.gaugeMaintenanceId == dataStr[j].gaugeMaintenanceId)dataStr.splice(j,1);
                    }
                });
            }
    
            rend();
            $(".delbtn").addClass("layui-btn-disabled");$(".delbtn").children().css('color','#C9C9C9');
	    })
    });
    $('.addbtn').click(function () {
        var checkStatus = table.checkStatus('dhtable'), data = [];
        data = checkStatus.data;
        $.each(data, function (i, v) {
            var flag = false;
            if (fmoduleTable == 'HW_FINALSTATEMENT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.bid == dataStr[j].bid) flag = true;
                }
                if(!flag)dataStr.push({'pguid':v.pguid,'codeqdcompany':v.codeqdcompany,'namecompany':v.namecompany,'bid':v.bid,'stockOutCode':v.stockOutCode,'shipmentid':v.shipmentid,'vgsjc':v.vgsjc, 'shopName':v.shopName,'launchwarehouse':v.launchwarehouse,'destinationfulfillmentcenterid':v.destinationfulfillmentcenterid,'countrycode':v.countrycode,'city':v.city,
                    'weightreal':v.weightreal,'weightvol':v.weightvol,'weightcal':v.weightcal,'numbox':v.numbox,'numcommodity':v.numcommodity,'lastvoyagecharge':v.lastvoyagecharge}); //排除已选中
            }else if (fmoduleTable == 'TS_CUSTOMSCLEARANCE') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.code == dataStr[j].code) flag = true;
                }
                if(!flag)dataStr.push({'code':v.code,'namelogsticsway':v.namelogsticsway,'codelogsticsserver':v.codelogsticsserver,'guidYl':v.guidYl}); //排除已选中
            }else if (fmoduleTable == 'TCC_StockUpdate') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guidKc == dataStr[j].guidKc) flag = true;
                }
                if(!flag)dataStr.push({'guidKc':v.guidKc,'codeMerge':v.codeMerge,'productCode':v.productCode,'productName':v.productName,'productNum':v.productNum,
                    'productNumAll':v.productNumAll,'vHw':v.vHw, 'vKq':v.vKq,'gDepot':v.gDepot}); //排除已选中
            }else  if (fmoduleTable == 'HW_FINALPAYMENT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.tpBid == dataStr[j].tpBid) flag = true;
                }
                if(!flag)dataStr.push({'tpBid':v.tpBid,'fsBid':v.fsBid,'stockOutCode':v.stockOutCode,'lastVoyageChargeXt':v.lastVoyageChargeXt, 'lastvoyagechargedz':v.lastvoyagechargedz,'lastVoyageChargeFk':v.lastVoyageChargeFk,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany});	//排除已选中
            }else  if (fmoduleTable == 'HW_PAYMENT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.dzBid == dataStr[j].dzBid) flag = true;
                }
                if(!flag)dataStr.push({'dzBid':v.dzBid,'hwMonth':v.hwMonth,'sjRkAmount':v.sjRkAmount,'sjKcAmount':v.sjKcAmount, 'sjCkAmount':v.sjCkAmount,'sjAmount':v.sjAmount});  //排除已选中
            } else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) flag = true;
                }
                if(!flag)dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'codereconcile':v.codereconcile,'waybillNumber':v.waybillNumber,'logisticsFeesSj':v.logisticsFeesSj, 'logisticsFeesXs':v.logisticsFeesXs,'logisticsFeesDz':v.logisticsFeesDz,'logisticsFeesFk':v.logisticsFeesFk,'logisticsFreightXt':v.logisticsFreightXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});	//排除已选中
            }else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENTEC') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) flag = true;
                }
                if(!flag)dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'codereconcileEc':v.codereconcileEc,'waybillNumber':v.waybillNumber,'residueFees':v.residueFees, 'logisticsFeesXs':v.logisticsFeesXs,'logisticsFeesDz':v.logisticsFeesDz,'logisticsFeesFk':v.logisticsFeesFk,'logisticsFreightXt':v.logisticsFreightXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});    //排除已选中
            }else if (fmoduleTable == 'TP_FBALOGSTICSORDER') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) flag = true;
                }
                if (!flag) dataStr.push({'logisticsOrderCode':v.logisticsOrderCode,'nameLogsticsWay':v.nameLogsticsWay,'codeLogsticsServer':v.codeLogsticsServer, 'nameLogsticsPattern':v.nameLogsticsPattern,'waybillNumber':v.waybillNumber,'logisticsFeesSj':v.logisticsFeesSj, 'logisticsFeesXs':v.logisticsFeesXs,'numBoxXt':v.numBoxXt,'weightCalXt':v.weightCalXt,'logisticsFreightXt':v.logisticsFreightXt,'materialSurchargeXt':v.materialSurchargeXt,'priceClearanceOpeXt':v.priceClearanceOpeXt,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'priceProNameExtraPredictXt':v.priceProNameExtraPredictXt,'type':v.type});	//排除已选中
            }else if (fmoduleTable == 'TP_FBALOGSTICSORDEREC') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) flag = true;
                }
                if(!flag)dataStr.push({'logisticsFeesFk':v.logisticsFeesFk,'logisticsOrderCode':v.logisticsOrderCode,'codereconcile':v.codereconcile,'nameLogsticsWay':v.nameLogsticsWay,'codeLogsticsServer':v.codeLogsticsServer, 'nameLogsticsPattern':v.nameLogsticsPattern,'waybillNumber':v.waybillNumber, 'logisticsFeesXs':v.logisticsFeesXs,'codeCompany':v.codeCompany,'nameCompany':v.nameCompany,'type':v.type});   //排除已选中
            }else if (fmoduleTable == 'YS_HYDICT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.id == dataStr[j].id) flag = true;
                }
                if(!flag)dataStr.push({'id':v.id,'dictname':v.dictname,'dictvalue':v.dictvalue});
            } else if (fmoduleTable == 'TP_FBAPLANORDER') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guidKc == dataStr[j].guidKc) flag = true;
                }
                // if (v.productWeight == undefined || v.productWeight == null || v.productWeight === '') {
                //     layer.msg(v.code + '组装信息未完善,请完善后在操作!');
                //     return
                // }
                if (!flag) dataStr.push({
                    'code': v.code,
                    'name': v.name,
                    'sku': v.sku,
                    'asin': v.asin,
                    'fnsku': v.fnsku,
                    'nameCn': v.nameCn,
                    'nameEn': v.nameEn,
                    'codeHs': v.codeHs,
                    'materialCn': v.materialCn,
                    'materialEn': v.materialEn,
                    'priceIn': v.priceIn,
                    'vHw': v.vHw,
                    'vKq': v.vKq,
                    'gDepot': v.gDepot,
                    'productNum': v.productNum,
                    "productWeight": v.productWeight,
                    'productLength': v.productLength,
                    'productWidth': v.productWidth,
                    'productHeight': v.productHeight,
                    'guidKc': v.guidKc,
                    'rkGuid': v.rkGuid,
                    'spGuid': v.spGuid,
                    'spId': v.spId,
                    'vGsBm': v.vGsBm,
                    'vSfJp': v.vSfJp
                });	//排除已选中
            } else if (fmoduleTable == 'TCG_PURCHASEPLAN') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.code == dataStr[j].code) flag = true;
                }
                if (!flag) dataStr.push({
                    'code': v.code,
                    'codeHs': v.codeHs,
                    'name': v.name,
                    'nameCn': v.nameCn,
                    'createUser': v.createUser,
                    'createTime': v.createTime,
                    'productNum': v.productNum
                });	//排除已选中
            } else if (fmoduleTable == 'TCG_PURCHASEPLANCANCEL') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.spBm == dataStr[j].spBm) flag = true;
                }
                if (!flag) dataStr.push({'spBm': v.spBm, 'spMc': v.spMc, 'spSl': v.spSl});	//排除已选中
            } else if (fmoduleTable == 'TCG_OFFLINEPURCHASEORDER') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.spBm == dataStr[j].guid) flag = true;
                }
                if (!flag) dataStr.push({
                    'bid': v.bid,
                    'vGsJc': v.vGsJc,
                    'vGsBm': v.vGsBm,
                    'spBm': v.spBm,
                    'spMc': v.spMc,
                    'planCost': v.planCost,
                    'spSl': v.spSl
                });	//排除已选中
            } else if (fmoduleTable == 'TCG_PAYMENT') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guid == dataStr[j].guid) flag = true;
                }
                v.guid = ""
                if (!flag) dataStr.push(v)
                // if(!flag)dataStr.push({'bid':v.bid,'planID':v.planID,'account':v.account,'orderNumber':v.orderNumber,'orderAmount':v.orderAmount,'state':v.state,'trackingNumber':v.trackingNumber,'warehouse':v.warehouse,'nid':v.nid});	//排除已选中
            } else if (fmoduleTable == 'TCG_OFFLINEPAYMENT' || fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE' ) {
                v.pGuid = v.guid
                for (var j = 0; j < dataStr.length; j++) {
                    // console.log(v.guid, dataStr[j].pGuid, 9999)
                    if (v.guid == dataStr[j].pGuid) flag = true;
                }
                if (!flag) dataStr.push(v)
            }else if (fmoduleTable=='HW_DELIVERYREQUEST_GUAGE' ) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.gaugeMaintenanceId == dataStr[j].gaugeMaintenanceId) flag = true;
                }
                v.guid = ""
                if (!flag) dataStr.push(v)
            }else if (fmoduleTable == 'TCW_CAPITALREGISTER') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.partnerId == dataStr[j].partnerId) flag = true;
                }
                if (!flag) dataStr.push({
                    'partnerId': v.partnerId,
                    'partnerName': v.partnerName,
                    'vKhh': v.vKhh,
                    'vYhZh': v.vYhZh
                });	//排除已选中
            }else if (fmoduleTable == 'TCW_CAPITALREGISTERCLAIM') {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.id == dataStr[j].id) flag = true;
                }
                if (!flag) dataStr.push({
                    'id': v.id,
                    'paymentBankName': v.paymentBankName,
                    'paymentBank': v.paymentBank,
                    'paymentBankAccount': v.paymentBankAccount,
                    'paymentAmount': v.paymentAmount,
                    'paymentTime': v.paymentTime
                });	//排除已选中
            }

        });
        rend();
        $('div.laytable-cell-checkbox').find('div.layui-form-checked').click();
        $(".addbtn").addClass("layui-btn-disabled");
        $(".addbtn").children().css('color', '#C9C9C9');
    })
    $('.delbtn').click(function () {
        var checkStatus = table.checkStatus('dhtable2'), data = [];
        data = checkStatus.data, objId = [];
        if (fmoduleTable == 'HW_FINALSTATEMENT') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.bid == dataStr[j].bid) dataStr.splice(j, 1);
                }
            });
        }else if (fmoduleTable == 'TS_CUSTOMSCLEARANCE') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.code == dataStr[j].code) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCC_StockUpdate') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guidKc == dataStr[j].guidKc) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'HW_FINALPAYMENT') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.tpBid == dataStr[j].tpBid) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'HW_PAYMENT') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.dzBid == dataStr[j].dzBid) dataStr.splice(j, 1);
                }
            });
        }else if (fmoduleTable == 'TP_FBALOGSTICSORDER') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) dataStr.splice(j, 1);
                }
            });
        }else if (fmoduleTable == 'TP_FBALOGSTICSORDEREC') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.logisticsOrderCode == dataStr[j].logisticsOrderCode) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TP_FBAPLANORDER') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guidKc == dataStr[j].guidKc) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCW_CAPITALREGISTER') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.partnerId == dataStr[j].partnerId) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCW_CAPITALREGISTERCLAIM') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.id == dataStr[j].id) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'YS_HYDICT') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.id == dataStr[j].id) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCG_PURCHASEPLAN' ) {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.code == dataStr[j].code) {
                        dataStr.splice(j, 1);
                    }
                }
            });
        } else if (fmoduleTable == 'TCG_PURCHASEPLANCANCEL') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.spBm == dataStr[j].spBm) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCG_OFFLINEPURCHASEORDER') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.spBm == dataStr[j].guid) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCG_PAYMENT') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guid == dataStr[j].guid) dataStr.splice(j, 1);
                }
            });
        } else if (fmoduleTable == 'TCG_OFFLINEPAYMENT'|| fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE') {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.guid == dataStr[j].pGuid) dataStr.splice(j, 1);
                }
            });
        }else if (fmoduleTable=='HW_DELIVERYREQUEST_GUAGE' ) {
            $.each(data, function (i, v) {
                for (var j = 0; j < dataStr.length; j++) {
                    if (v.gaugeMaintenanceId == dataStr[j].gaugeMaintenanceId) dataStr.splice(j, 1);
                }
            });
        }

        rend();
        $(".delbtn").addClass("layui-btn-disabled");
        $(".delbtn").children().css('color', '#C9C9C9');
    })
    var callbackdata = function () {
        if (pagetype == "checkbox") {
            return dataStr;
        } else {
            var checkStatus = table.checkStatus('dhtable')
                , data = checkStatus.data[0];//单选情况下只会返回一个
            return data;
        }
    }
    var dataStr = [];
    $(function () {
        if (fmoduleTable == 'TP_FBALOGISTICSPAYMENT') {
            getData("/logstics/fbaLogisticsReconcile/listselect?selectedUser=" + selectedObject);
        }else if (fmoduleTable == 'TP_FBALOGISTICSPAYMENTEC') {
            getData("/logstics/fbaLogisticsReconcileEc/listselect?selectedUser=" + selectedObject);
        } else if (fmoduleTable == 'HW_FINALSTATEMENT') {
            getData("/storage/hwTailprogram/listselect?selectedUser=" + selectedObject);
        }else if (fmoduleTable == 'TS_CUSTOMSCLEARANCE') {
            getData("/storage/tsCustomsclearance/listselect?selectedUser=" + selectedObject);
        }else if (fmoduleTable == 'TCC_StockUpdate') {
            getData("/storage/stockUpdate/listselect?selectedUser=" + selectedObject+ "&vGsBm=" + vGsBm);
        } else if (fmoduleTable == 'HW_FINALPAYMENT') {
            getData("/storage/hwFinalstatement/listselect?selectedUser=" + selectedObject);
        } else if (fmoduleTable == 'HW_PAYMENT') {
            getData("/storage/hwReconcile/listselect?selectedUser=" + selectedObject);
        }else if (fmoduleTable == 'TP_FBALOGSTICSORDER') {
            getData("/logstics/fbaLogisticsOrder/listselect?selectedUser=" + selectedObject);
        }else if (fmoduleTable == 'TP_FBALOGSTICSORDEREC') {
            getData("/logstics/fbaLogisticsReconcile/listselectEc?selectedUser=" + selectedObject);
        } else if (fmoduleTable == 'TP_FBAPLANORDER') {
            getData("/business/fbaplanorder/listselect?selectedUser=" + selectedObject + "&vGsBm=" + vGsBm);
        } else if (fmoduleTable == 'TCG_PURCHASEPLAN') {
            getData("/business/productactive/listselect?selectedUser=" + selectedObject);
        } else if (fmoduleTable == 'TCG_PURCHASEPLANCANCEL') {
            getData("/purchase/purchaseplan/listselect?selectedID=" + selectedObject);
        } else if (fmoduleTable == 'TCG_OFFLINEPURCHASEORDER') {
            getData("/purchase/purchaseplan/listselect2?selectedID=" + selectedObject);
        } else if (fmoduleTable == 'TCG_PAYMENT') {
            getData("/purchase/purchaseorder/listselect?selectedID=" + selectedObject);
        } else if (fmoduleTable == 'TCG_OFFLINEPAYMENT' || fmoduleTable == 'TCG_OFFLINEPURCHASESTORAGE') {
            getData("/purchase/offlinepurchaseorder/listselectGuid?selectedID=" + selectedObject);
        }

    })

    //获取数据
    function getData(url) {
        $.get(url, function (data, status) {
            if (data.count == 0) {
                dataStr = [];
                rend();
            } else {
                dataStr = [];
                for (var i = 0; i < data.data.length; i++) {
                    if (fmoduleTable == 'TCG_OFFLINEPAYMENT'|| fmoduleTable=='TCG_OFFLINEPURCHASESTORAGE') {
                        data.data[i].pGuid = data.data[i].guid
                        data.data[i].iid = i
                    }
                    dataStr.push(data.data[i])
                    if (i == data.data.length - 1) {
                        rend();
                    }
                }
            }
        });
    }

    //渲染表格
    function rend() {
        $.tablelist.init({
            elem: '#dhtable2'
            , cols: [fcols]
            , data: dataStr
            , height: 300
        });
    }
</script>
</body>
</html>
